package com.liyiruo.testMain;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author liyiruo
 * @Description
 * @Date 2023/4/19 上午12:22
 */
public class SimpDateFormatTest {
    public static void main(String[] args) throws ParseException {
        ApplicationContext context=new ClassPathXmlApplicationContext("simpDateFormat.xml");
        SimpleDateFormat dateFormat = context.getBean("dateFormat", SimpleDateFormat.class);
        String s = dateFormat.format(new Date());
        System.out.println(s);


        Object date = context.getBean("date");
        System.out.println(date);
    }
}
